﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OwnerTransFerDetail.aspx.cs" Inherits="WMS6.Web.Inventory.OwnerTransFerDetail" %>

<%@ Register Src="../UserControls/LotAtrributeCtrl.ascx" TagName="LotAtrributeCtrl"
    TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>OwnerTransFerDetail</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />

    <script src="../Js/jquery.js" type="text/javascript"></script>

    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>

    <script src="../Js/util.js" type="text/javascript"></script>

    <script src="../Js/calendar.js" type="text/javascript" charset="gb2312"></script>

    <script src="../Js/InitPage.js" type="text/javascript"></script>

    <script src="../Js/Verification.js" type="text/javascript"></script>

    <script type="text/javascript">
        //初始化页面
        window.onload = function(){
            initDetailPage();
            setLotValue();
        }
        
         //弹出窗口选择货品
        function selectSku(skuID)
        {
        
            var ownerID;
            if(skuID == 'txtFromSkuID')
            {
              ownerID =document.getElementById("hdnFromOwnerID").value;
            }
            else
            {
               ownerID =document.getElementById("hdnToOwnerID").value;                  
            }
            
            var rtnValue = popModalWindow('../Configuration/SkuQuery.aspx?action=txtSkuID&ownerID=' + escape(ownerID), 'dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if(rtnValue != null && rtnValue.toString() != "")
            {
                document.getElementById(skuID).focus();
                document.getElementById(skuID).value = rtnValue;
                document.getElementById(skuID).value = rtnValue;
                if(skuID=='txtFromSkuID')
                {
                   __doPostBack("txtFromSkuID_TextChanged","");
                }
                else
                {
                  __doPostBack("txtToSkuID_TextChanged","");                
                }
            }
        }
        
           //设置批次属性值
        function setLotValue()
        {
            for(var i =1;i<11;i++)
            {                
                if(document.getElementById("LotAtrributeCtrl1_ctrl"+i) != null)
                {
                    if(document.getElementById("hdnType").value == "")  //非编辑状态，从ReceiptDetail中批次属性值
                    {
                        if(document.getElementById("LotAtrributeCtrl1_ctrl"+i).value.indexOf(",") == 0)
                        {
                            if(document.getElementById("LotAtrributeCtrl1_ctrl"+i).value == "")
                            {
                                document.getElementById("LotAtrributeCtrl1_ctrl"+i).value = document.getElementById("hdnLot"+i).value;
                            }
                        }
                    }
                    else  //编辑状态 取批次属性的默认值
                    {
                        if(document.getElementById("hdnLot"+i).value.indexOf(",") > 0)
                        {
                            document.getElementById("hdnLot"+i).value = "";
                        }
                        document.getElementById("LotAtrributeCtrl1_ctrl"+i).value = document.getElementById("hdnLot"+i).value;
                    }
                }
            }
            if(document.getElementById("LotAtrributeCtrl1_txtProduct") != null)
            {
                if(document.getElementById("hdnType").value == "") //非编辑状态，从ReceiptDetail中批次属性值
                {
                    if(document.getElementById("LotAtrributeCtrl1_txtProduct").value.indexOf(",") == 0)
                    {
                        if(document.getElementById("LotAtrributeCtrl1_txtProduct").value == "")
                        {
                            document.getElementById("LotAtrributeCtrl1_txtProduct").value = document.getElementById("hdnProductDate").value;
                        }
                    }
                }
                else  //编辑状态 取批次属性的默认值
                {
                    if(document.getElementById("hdnProductDate").value.indexOf(",") > 0)
                    {
                        document.getElementById("hdnProductDate").value = "";
                    }
                    document.getElementById("LotAtrributeCtrl1_txtProduct").value = document.getElementById("hdnProductDate").value;
                }
            }
            if(document.getElementById("LotAtrributeCtrl1_txtExpiryDate") != null)
            {
                if(document.getElementById("hdnType").value == "") //非编辑状态，从ReceiptDetail中批次属性值
                {
                    if(document.getElementById("LotAtrributeCtrl1_txtExpiryDate").value.indexOf(",") == 0)
                    {
                        if(document.getElementById("LotAtrributeCtrl1_txtExpiryDate").value == "")
                        {
                            document.getElementById("LotAtrributeCtrl1_txtExpiryDate").value = document.getElementById("hdnExpiryDate").value;
                        }
                    }
                }
                else  //编辑状态 取批次属性的默认值
                {
                    if(document.getElementById("hdnExpiryDate").value.indexOf(",") > 0)
                    {
                        document.getElementById("hdnExpiryDate").value = "";
                    }
                    document.getElementById("LotAtrributeCtrl1_txtExpiryDate").value = document.getElementById("hdnExpiryDate").value;
                }
            }
            
            
            if(document.getElementById("LotAtrributeCtrl1_txtExternalLot") != null)
            {
                if(document.getElementById("hdnType").value == "") //非编辑状态，从ReceiptDetail中批次属性值
                {
                    if(document.getElementById("LotAtrributeCtrl1_txtExternalLot").value.indexOf(",") == 0)
                    {
                        if(document.getElementById("LotAtrributeCtrl1_txtExternalLot").value == "")
                        {
                            document.getElementById("LotAtrributeCtrl1_txtExternalLot").value = document.getElementById("hdnExternal").value;
                        }
                    }
                }
                else  //编辑状态 取批次属性的默认值
                {
                    if(document.getElementById("hdnExternal").value.indexOf(",") > 0)
                    {
                        document.getElementById("hdnExternal").value = "";
                    }
                    document.getElementById("LotAtrributeCtrl1_txtExternalLot").value = document.getElementById("hdnExternal").value;
                }
            }
            
        }
    </script>

</head>
<body>
    <form id="F5068" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="div_top">
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:Label ID="lblTransferDetail" runat="server" CssClass="label_header" 
                            Text="库存转移明细" meta:resourcekey="lblTransferDetail"></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnCancel" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnCancel%>" AccessKey="c"
                            OnClick="btnCancel_Click" ValidationGroup="aaa" Enabled="false"  />
                    </td>
                    <%--                    <td><asp:Button ID="btnDelete" runat="server" CssClass="button" Text="删除" 
                            AccessKey="c" onclick="btnDelete_Click" /></td>--%>
                  
                    <td>
                        <asp:Button ID="btnSave" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnSave%>" AccessKey="s"
                            OnClick="btnSave_Click"  Enabled="false"  />
                    </td>
                    <td>
                
                    </td>
                </tr>
            </table>
        </div>
        <div>
            <asp:Label ID="lblMsg" runat="server" CssClass="label_message" 
                meta:resourcekey="lblMsg"></asp:Label>
        </div>
        <div id="div_menu">
            <div style="float: left; width: 8px;">
                <div class="tabL" id="divL1">
                </div>
            </div>
            <div style="float: left;" class="tabLabelCont tabCur" id="divM1">
                <asp:Label ID="one1" CssClass="hover" runat="server" 
                    meta:resourcekey="one1">货权转移</asp:Label></div>
            <div style="float: left; margin-right: 2px;">
                <div class="tabR" id="divR1">
                </div>
            </div>
        </div>
        <div id="div_content">
            <div id="con_one_1" style="display: block;">              
                <table width="900px" style="display: block; margin-left: 10px; margin-top: 10px;">
                    <tr>
                        <td width="180px">
                            <asp:Label ID="lblLineID" runat="server" CssClass="label" Text="行号" 
                                meta:resourcekey="lblLineID"></asp:Label>
                        </td>
                        <td width="180px">
                            <asp:Label ID="lblStatus" runat="server" CssClass="label" Text="状态" 
                                meta:resourcekey="lblStatus"></asp:Label>
                        </td>
                        <td width="180px">
                            &nbsp;
                        </td>
                           <td width="180px">
                            &nbsp;
                        </td>
                           <td width="180px">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td width="180px">
                            <asp:TextBox ID="txtLineID" runat="server" CssClass="textbox" Enabled="False" 
                                meta:resourcekey="txtLineID"></asp:TextBox>
                        </td>
                        <td width="180px">
                            <asp:TextBox ID="txtStatus" runat="server" CssClass="textbox" Enabled="False" 
                                meta:resourcekey="txtStatus"></asp:TextBox>
                        <td width="180px">
                            &nbsp;
                        </td>
                           <td width="180px">
                            &nbsp;
                        </td>
                           <td width="180px">
                            &nbsp;
                        </td>
                         
                    </tr>               
                    <tr>
                        <td width="180px">
                            <asp:Label ID="lblFromSkuID" runat="server" CssClass="label" Text="原货品代码" 
                                meta:resourcekey="lblFromSkuID"></asp:Label><font
                                class="must_input">*</font>
                        </td>
                        <td width="180px">
                            <asp:Label ID="lblFromSkuDescr" runat="server" CssClass="label" Text="货品描述" 
                                meta:resourcekey="lblFromSkuDescr"></asp:Label>
                        </td>
                        <td width="180px">
                            <asp:Label ID="lblToSkuID" runat="server" CssClass="label" Text="至货品代码" 
                                meta:resourcekey="lblToSkuID"></asp:Label><font
                                class="must_input">*</font>
                        </td>
                         <td width="180px">
                            <asp:Label ID="lblToSkuDescr" runat="server" CssClass="label" Text="货品描述" 
                                meta:resourcekey="lblToSkuDescr"></asp:Label>
                        </td>
                        <td width="180px">
                        </td>
                    </tr>
                    <tr>
                        <td width="180px">
                            <asp:TextBox ID="txtFromSkuID" runat="server" CssClass="textbox" OnTextChanged="txtFromSkuID_TextChanged"
                               AutoPostBack="True"  meta:resourcekey="txtFromSkuID" ></asp:TextBox>
                             <img src="../Images/icon_find.gif" alt="select one item" class="img" onclick="selectSku('txtFromSkuID');" id="img1" />
                        </td>
                        <td width="180px">                          
                            <asp:TextBox ID="txtFromSkuDescr" runat="server" CssClass="textbox"   
                                Enabled="False" meta:resourcekey="txtFromSkuDescr" ></asp:TextBox>
                        </td>
                       <td width="180px">
                         <asp:TextBox ID="txtToSkuID" runat="server" CssClass="textbox"  meta:resourcekey="txtToSkuID" OnTextChanged="txtToSkuID_TextChanged" AutoPostBack="true"></asp:TextBox>
                            <img src="../Images/icon_find.gif" alt="select one item" class="img" onclick="selectSku('txtToSkuID');"  id="img2" />
                        </td>
                        <td width="180px">
                            <asp:TextBox ID="txtToSkuDescr" runat="server" CssClass="textbox"  Enabled="False"
                                meta:resourcekey="txtToSkuDescr"></asp:TextBox>
                        </td>
                          <td width="180px">
                        </td>
                    </tr>  
                    <tr>
                        <td width="180px">
                            <asp:Label ID="lblFromPackID" runat="server" CssClass="label" Text="包装" 
                                meta:resourcekey="lblFromPackID"></asp:Label>
                        </td>
                        <td width="180px">
                            <asp:Label ID="lblFromUomID" runat="server" CssClass="label" Text="计量单位" 
                                meta:resourcekey="lblFromUomID"></asp:Label>
                        </td>
                        <td width="180px">
                        <asp:Label ID="lblToQty" runat="server" CssClass="label" Text="数量" 
                                meta:resourcekey="lblToQty"></asp:Label><font
                                class="must_input">*</font>
                        </td>
                        <td width="180px">
                        </td>
                        <td width="180px">
                        </td>
                    </tr>
                    <tr>
                        <td width="180px">
                            <asp:TextBox ID="txtFromPackID" runat="server"  Enabled="False"  
                                CssClass="textbox"
                               meta:resourcekey="txtFromPackID"></asp:TextBox>
                        </td>
                        <td width="180px">
                            <asp:DropDownList ID="ddlFromUomID"  Enabled="False"  runat="server" 
                                CssClass="mediumselectbox" meta:resourcekey="ddlFromUomID">
                            </asp:DropDownList>
                        </td>
                        <td width="180px">
                          <asp:TextBox ID="txtToQty" runat="server" CssClass="textbox" 
                                meta:resourcekey="txtToQty"></asp:TextBox>
                        </td>
                        <td width="180px">
                        </td>
                        <td width="180px">
                        </td>
                    </tr>                
                    <tr style="height: 20px;">
                        <td>
                        </td>
                        <td>
                        </td>
                        <td>
                        </td>
                    </tr>
                </table>
                   <table style="display:block; margin-left:10px; ">
                            <tr>
                                <td><uc1:LotAtrributeCtrl ID="LotAtrributeCtrl1" runat="server" /></td>
                            </tr>
                            <tr style="height: 10px;">
                                <td>
                                </td>
                            </tr>
                        </table>
                    <input type="hidden" id="hdnFrom" runat="server" />
                    <input type="hidden" id="hdnTransferID" runat="server" />
                    <input type="hidden" id="hdnFromOwnerID" runat="server" />
                    <input type="hidden" id="hdnToOwnerID" runat="server" />
                    <input type="hidden" id="hdnFromSkuID" runat="server" />
                    <input type="hidden" id="hdnToSkuID" runat="server" />
                    <input type="hidden" id="hdnOriginQty" runat="server" />
                    <input type="hidden" id="hdnToOriginQty" runat="server" />
                    <input type="hidden" id="hdnType" runat="server" />
                    <input type="hidden" id="hdnDataFormat" runat="server" />
                    <input type="hidden" id="hdncalendarFlag" runat="server" />
                <asp:HiddenField ID="hdnLot1" runat="server" />
                <asp:HiddenField ID="hdnLot2" runat="server" />
                <asp:HiddenField ID="hdnLot3" runat="server" />
                <asp:HiddenField ID="hdnLot4" runat="server" />
                <asp:HiddenField ID="hdnLot5" runat="server" />
                <asp:HiddenField ID="hdnLot6" runat="server" />
                <asp:HiddenField ID="hdnLot7" runat="server" />
                <asp:HiddenField ID="hdnLot8" runat="server" />
                <asp:HiddenField ID="hdnLot9" runat="server" />
                <asp:HiddenField ID="hdnLot10" runat="server" />
                <asp:HiddenField ID="hdnProductDate" runat="server" />
                <asp:HiddenField ID="hdnExpiryDate" runat="server" />
                <asp:HiddenField ID="hdnExternal" runat="server" />
                <%--</ContentTemplate>
                </asp:UpdatePanel>--%>
                
            </div>
        </div>
    </div>
    
    </form>
</body>
</html>
<script language="javascript" type="text/javascript" event="onclick" for="document">
		<!--
			hiddenCalendarDiv();
		//-->
</script>
